package com.example.Service.Impl;

import com.example.Dao.UserMapper;
import com.example.Service.UserService;
import com.example.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    //查询用户是否存在
    @Override
    public User selectUser(String phone, String email) {

        return userMapper.selectUser(phone,email);
    }

    //用户注册
    @Override
    public void addUser(String phone, String email, String password) {
        userMapper.addUser(phone,email,password);
    }

    //查看用户详情，不返回密码
    @Override
    public User selectUser1(String phone) {
        return userMapper.selectUser1(phone);
    }


    @Override
    public User selectUser02(String oldPassword, Integer createId) {
        return userMapper.seletcRePs(oldPassword,createId);
    }

    //修改密码
    @Override
    public void updataPasswd(String newPassword, Integer createId) {
        userMapper.updataPs(newPassword,createId);

    }


}
